<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path;
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
<title>我的班级-云校通</title>
<jsp:include page="/WEB-INF/page/common/_header.jsp"></jsp:include>
<body ontouchstart class="js-jf" style="background:#fff;">
	<div class="weui_tab tab-bottom">
        <div class="weui_tab_bd">
        	<div class="weui-header bg-blue"> 
		  		<div class="weui-header-left"> <a href="javascript:;" onclick="back()" class="icon icon-109 f-white">返回</a> </div>
		    	<h1 class="weui-header-title">班级留言板</h1>
		    </div>
		    <c:if test="${list != null }">
				<div class="xzbjWrap" style="padding: 100px 0;">
					<div class="xzbj-list mt0">
						<ul>
							<c:forEach var="itm" items="${list }">
								<a href="<%=basePath %>${redirectUrl }?grade=${itm.grade }&clazz=${itm.clazz }"><li><p class="tm">${itm.gradeText }（${itm.clazz }）班</p></li></a>
							</c:forEach>
						</ul>
					</div>
				</div>
			</c:if>
			<c:if test="${leaderList != null }">
				<div class="hb_choose type2" style="width: 100%; top: 44px;left: 0px; display: block; transform-origin: 0px 0px 0px; opacity: 1; transform: scale(1, 1);">
					<div class="bj">
						<ul class="title">
							<c:forEach var="itm" items="${leaderList }" varStatus="status">
								<li class="<c:if test='${status.index == 0 }'>active </c:if>" data-key="s${itm.grade }">${itm.gradeText }</li>
							</c:forEach>
						</ul>
						<c:forEach var="itm" items="${leaderList }" varStatus="status">
							<div class="yng" id="s${itm.grade }" <c:if test='${status.index == 0 }'>style="display: block;" </c:if>>
								<ul class="list_3">
									<c:forEach var="itm1" items="${itm.classList }">
										<a href="<%=basePath %>${redirectUrl }?grade=${itm1.grade }&clazz=${itm1.clazz }">
											<li><div class="weui_cell_hd list_c3 f-red">
												${itm1.clazz }班
											</div></li>
										</a>
									</c:forEach>
								</ul>
		   					</div>
						</c:forEach>
					</div>
				</div>
			</c:if>
		</div>
	</div>
</body>
<jsp:include page="/WEB-INF/page/common/_footer.jsp"></jsp:include>
<script type="text/javascript">
	$(function() {
		var obj = $(".xzbj-list a");
		if(obj.length == 1) {
			window.location.href=obj[0].href;
		}
		$(document).on("click", ".hb_choose .title>li", function(e) {
			$(this).addClass("active").siblings().removeClass("active");
			$(".yng").hide();
			$("#" + $(this).attr("data-key")).show();
    	});
	})
</script>
</html>